package com.app.TCES.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.app.TCES.domain.Teacher_Course;
import com.app.TCES.service.StudentService;


@Controller
public class TiaoZhuanController {

	Logger log = LogManager.getLogger(TiaoZhuanController.class);
	
	@Autowired
	StudentService studentService;
	

	@RequestMapping("/StudentCP")
	public String StudentCP(HttpServletRequest request) {
		
		return "/StudentCP";
	}

	//评教(学生)
	@RequestMapping("/StudentPJ")
	public String StudentPJ(HttpServletRequest request, Model model) {
		HttpSession httpSession=request.getSession();
        log.debug(httpSession.getAttribute("userId"));
		
        List<Teacher_Course> tc = studentService.selectTeacherBy_stuId(httpSession.getAttribute("userId"));
        model.addAttribute("teachers", tc);
		return "/StudentPJ";
	}
	
	//跳转我的课程页面(学生)
	@RequestMapping("/MyCourse")
	public String MyCourse(HttpServletRequest request, Model model) {
        HttpSession httpSession=request.getSession();
        log.debug(httpSession.getAttribute("userId")); 
		model.addAttribute("selectCourse", studentService.selectC(httpSession.getAttribute("userId")));
		return "/StudentCourse";
	}

	@RequestMapping("/TeacherCP")
	public String TeacherCP(HttpServletRequest request) {
		
		return "/TeacherCP";
	}

	@RequestMapping("/Admin_index")
	public String Admin_index(HttpServletRequest request) {
		return "/Admin_index";
	}

	@RequestMapping("/Admin_class")
	public String Admin_class(HttpServletRequest request) {
		return "/Admin_class";
	}

	@RequestMapping("/Admin_course_class")
	public String Admin_course_class(HttpServletRequest request) {
		return "/Admin_course_class";
	}

	@RequestMapping("/Admin_course")
	public String Admin_course(HttpServletRequest request) {
		return "/Admin_course";
	}

	@RequestMapping("/Admin_dept")
	public String Admin_dept(HttpServletRequest request) {
		return "/Admin_dept";
	}

	@RequestMapping("/Admin_evaluate1")
	public String Admin_evaluate1(HttpServletRequest request) {
		return "/Admin_evaluate1";
	}

	@RequestMapping("/Admin_evaluate2")
	public String Admin_evaluate2(HttpServletRequest request) {
		return "/Admin_evaluate2";
	}

	@RequestMapping("/Admin_evaluate3")
	public String Admin_evaluate3(HttpServletRequest request) {
		return "/Admin_evaluate3";
	}

	@RequestMapping("/Admin_student")
	public String Admin_student(HttpServletRequest request) {
		return "/Admin_student";
	}

	@RequestMapping("/Admin_teacher")
	public String Admin_teacher(HttpServletRequest request) {
		return "/Admin_teacher";
	}
	
	
	
	
}
